home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 7 / Example 7.4 / debug.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-02-23  |  558 b   |  25 lines

  1. #ifndef cj_debug
  2. #define cj_debug
  3.  
  4. #include <d3dx9.h>
  5. #include <fstream>
  6.  
  7. #define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
  8. #define KEYUP(vk_code)   ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)
  9.  
  10. class DEBUG{
  11.     public:
  12.         DEBUG();
  13.         ~DEBUG();
  14.         void Print(char c[]);
  15.         std::ofstream& operator<<(char c[]);
  16.         std::ofstream& operator<<(int i);
  17.         std::ofstream& operator<<(float f);
  18.         std::ofstream& operator<<(bool b);
  19.         std::ofstream& operator<<(D3DXVECTOR3 v);
  20.         void Endl(int nr);
  21. };
  22.  
  23. static DEBUG debug;
  24.  
  25. #endif